#ifndef _DevicesADC_H_
#define _DevicesADC_H_


/* DCDC 输出电压 */
#define ADC_SAMPLE_DCDC_OUT_VOLTAGE             ADC_CHANNEL_0
/* DCDC 输出电压 */
#define ADC_SAMPLE_DCDC_OUT_CURRENT             ADC_CHANNEL_1
/* DCDC 电感电流 */
#define ADC_SAMPLE_DCDC_INDUCTIVE_CURRENT       ADC_CHANNEL_4
/* DCDC B 电感电流 */
#define ADC_SAMPLE_DCDC_B_INDUCTIVE_CURRENT     ADC_CHANNEL_6
/* DCDC 输入电压 & 电池电压 */
#define ADC_SAMPLE_DCDC_IN_VOLTAGE              ADC_CHANNEL_2
/* DCDC 温度 */
#define ADC_SAMPLE_DCDC_TEMPERATURE             ADC_CHANNEL_7


typedef enum {
    /* 输出电压 */
    ADC_DMA_SCAN_DCDC_OUT_VOLTAGE = 0,
    /* 输出电流 */
    ADC_DMA_SCAN_DCDC_OUT_CURRENT,
    /* 电感电流 */
    ADC_DMA_SCAN_DCDC_INDUCTIVE_CURRENT,
    /* 电感电流 */
    ADC_DMA_SCAN_DCDC_B_INDUCTIVE_CURRENT,
    /* 输入电压 */
    ADC_DMA_SCAN_DCDC_IN_VOLTAGE,
    /* 温度 */
    ADC_DMA_SCAN_DCDC_TEMPERATURE,

    /* 最大的通道值 */
    ADC_DMA_SCAN_MAX,
} AdcDmaScanChannelEnum;


/* 采样扫描通道数量 */
#define ADC0_SAMPLING_CHANNEL   ADC_DMA_SCAN_MAX
/* 每通道采样次数 */
#define ADC0_SAMPLING_NUMBER    1
/* 采样时间 */
#define ADC0_SAMPLE_TIME        ADC_SAMPLETIME_28POINT5


void vADCInit(void);
void vADCWatchdogInit(void);
void vADCWatchdogSwitchSet(int8_t cState);

int32_t iADCGetDMAValue(uint8_t ucChannel);
float fADCGetDMAValue(uint8_t ucChannel);
float fADCGetChannelValue(uint32_t adc_periph, uint8_t channel, uint32_t uiCnt);


#endif 
